package com.cd.form.api;

import com.cd.form.jpa.domian.FormComponent;
import com.cd.form.jpa.domian.FormInstance;
import com.cd.form.jpa.domian.FormResult;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

public interface FormService {

    List<FormComponent> getFormComponentByFormId(Long formId);

    void submitForm(FormResult formResult);

    FormInstance getFormInfo(Long formId);

    List<FormResult> getFormResult(Long formId);

    List<FormResult> getFormResultWithStatus(Long formId, Integer status);

    void updateStatus(FormResult formResult);

    List<FormInstance> getFormInstance(Long formId, String name);

    void createFormInstance(FormInstance formInstance);

    void updateFormInstance(FormInstance formInstance);

    void updateFormComponentBatch(List<FormComponent> formComponents);

    void createFormComponent(FormComponent formComponent);

    void updateFormComponent(FormComponent formComponent);

    void removeFormComponent(Long formComponentId);

    void copyFormComponent(Long fromFormId, Long currentFromId);

    void excelImport(Long formId, HttpServletResponse response);
}
